<?php

/**
 * ReferentielMantis form base class.
 *
 * @method ReferentielMantis getObject() Returns the current form's model object
 *
 * @package    kc_report_proto
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseReferentielMantisForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'rma_id'               => new sfWidgetFormInputHidden(),
      'rma_libelle'          => new sfWidgetFormInputText(),
      'rma_lien'             => new sfWidgetFormTextarea(),
      'rma_hostname'         => new sfWidgetFormInputText(),
      'rma_database'         => new sfWidgetFormInputText(),
      'rma_username'         => new sfWidgetFormInputText(),
      'rma_password'         => new sfWidgetFormInputText(),
      'rma_enum_severite'    => new sfWidgetFormTextarea(),
      'rma_enum_statut'      => new sfWidgetFormTextarea(),
      'rma_enum_resolution'  => new sfWidgetFormTextarea(),
      'rma_sev_mineur'       => new sfWidgetFormInputText(),
      'rma_sev_majeur'       => new sfWidgetFormInputText(),
      'rma_sev_bloquant'     => new sfWidgetFormInputText(),
      'rma_sta_detecte'      => new sfWidgetFormInputText(),
      'rma_sta_resolu'       => new sfWidgetFormInputText(),
      'rma_sta_livre'        => new sfWidgetFormInputText(),
      'rma_sta_ferme'        => new sfWidgetFormInputText(),
      'rma_enum_sta_attente' => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'rma_id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('rma_id')), 'empty_value' => $this->getObject()->get('rma_id'), 'required' => false)),
      'rma_libelle'          => new sfValidatorString(array('max_length' => 128)),
      'rma_lien'             => new sfValidatorString(array('max_length' => 256)),
      'rma_hostname'         => new sfValidatorString(array('max_length' => 128)),
      'rma_database'         => new sfValidatorString(array('max_length' => 128)),
      'rma_username'         => new sfValidatorString(array('max_length' => 128)),
      'rma_password'         => new sfValidatorString(array('max_length' => 128)),
      'rma_enum_severite'    => new sfValidatorString(array('max_length' => 256)),
      'rma_enum_statut'      => new sfValidatorString(array('max_length' => 256)),
      'rma_enum_resolution'  => new sfValidatorString(array('max_length' => 256)),
      'rma_sev_mineur'       => new sfValidatorInteger(array('required' => false)),
      'rma_sev_majeur'       => new sfValidatorInteger(),
      'rma_sev_bloquant'     => new sfValidatorInteger(),
      'rma_sta_detecte'      => new sfValidatorInteger(),
      'rma_sta_resolu'       => new sfValidatorInteger(),
      'rma_sta_livre'        => new sfValidatorInteger(),
      'rma_sta_ferme'        => new sfValidatorInteger(),
      'rma_enum_sta_attente' => new sfValidatorString(array('max_length' => 128)),
    ));

    $this->widgetSchema->setNameFormat('referentiel_mantis[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ReferentielMantis';
  }

}
